import { createRouter, createWebHistory } from 'vue-router'

const HomeView = () => import('@/views/home/home.vue')
const Layout = () => import('@/layouts/index.vue')
const DemoView = () => import('@/views/demo/demo.vue')
const Demo2View = () => import('@/views/demo3/demo3.vue')
const Demo4View = () => import('@/views/demo4/demo4.vue')

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: Layout,
      redirect: '/dashboard',
      meta: { title: '首页', icon: 'dashboard' },
      children: [
        {
          path: 'dashboard',
          name: 'dashboard',
          component: HomeView,
          meta: { title: '首页', affix: true }
        }
      ]
    },
    {
      path: '/about',
      name: 'about',
      component: DemoView
    }
  ]
})

export default router
